package org.aoao.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.ArrayList;

@Controller
public class HelloController {

    @RequestMapping("/test")
    public String index(Model model){
        model.addAttribute("msg","hello, boot/mvc/jsp!");
        return "index";
    }
    @RequestMapping("/hello")
    @ResponseBody
    public String hello(Model model){
        model.addAttribute("msg","hello, boot/mvc!");
        return "hello,spring boot";
    }
}
